<?php
namespace app\api\validate;

use think\Validate;

class Account extends Validate
{
    protected $rule =   [
        'account'  => 'require|mobile',
        'password' => 'require|min:6',
        'code'     => 'require|min:6',
        'from'     => 'require'
    ];

    protected $message  =   [
        'account.require' => '账户不能为空',
        'account.mobile'  => '账户不符合手机格式',
        'password.require'  => '密码不能为空',
        'password.min'  => '密码长度不能低于6位',
        'code.require' => '临时票据code不能为空',
        'code.min'  => 'code长度不能低于6位',
    ];

    protected $scene = [
        // 登录场景
        'login'  =>  ['account','password','from'],
        // 微信扫码登录场景
        'wxlogin'  =>  ['code','from']
    ];

}